# 根据给定的年月日以数字形式打印出日期
# raw_input在Python 3以后被废弃，统一使用input
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November',
          'December']

# 以1-31的数字作为结尾的列表
endings = ['st', 'nd', 'rd'] + 17 * ['th'] + ['st', 'nd', 'rd'] + 7 * ['th'] + ['st']

year = input('Year: ')
month = input('Month(1-12): ')
day = input('Day(1-31): ')

month_number = int(month)
day_number = int(day)


month_name = months[month_number - 1]
day_name = day + endings[day_number - 1]

print(month_name + ' ' + day_name + ', ' + year)
